<?php

namespace Ipartek\BlogBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * Contacto
 * @ORM\HasLifecycleCallbacks
 * @ORM\Table(name="contacto")
 * @ORM\Entity
 */
class Contacto
{
	
	
    /**
     * @var integer 
     * @ORM\Column(name="id", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="IDENTITY")
     */
    private $id;

    /**
     * @var string
     * @Assert\NotBlank(message="Falta Nombre")
     * @ORM\Column(name="nombre", type="string", length=255, nullable=false)
     */
    private $nombre;

    /**
     * @var string
     * @Assert\NotBlank(message="Falta Email")
     * @ORM\Column(name="email", type="string", length=255, nullable=false)
     */
    private $email;

    /**
     * @var string
     * @Assert\NotBlank
     * @ORM\Column(name="telefono", type="text", nullable=false)
     */
    private $telefono;

    /**
     * @var string
     * @Assert\NotBlank(message="Falta Provincia")
     * @ORM\Column(name="provincia", type="string", length=255, nullable=false)
     */
    private $provincia;

    /**
     * @var string
     * @Assert\NotBlank
     * @ORM\Column(name="consulta", type="text", nullable=false)
     */
    private $consulta;

    /**
     * @var boolean     * 
     * @ORM\Column(name="respondido", type="boolean", nullable=false)
     */
    private $respondido;

    /**
     * @var string
     *
     * @ORM\Column(name="anotaciones", type="text", nullable=true)
     */
    private $anotaciones;
    
    /**
     * @ORM\Column(type="datetime")
     */
    protected $created_at;
    
    /**
     * @ORM\Column(type="datetime")
     */
    protected $modified_at;
    
    
    
    



    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     * @return Contacto
     */
    public function setNombre($nombre)
    {
        $this->nombre = $nombre;
    
        return $this;
    }

    /**
     * Get nombre
     *
     * @return string 
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Set email
     *
     * @param string $email
     * @return Contacto
     */
    public function setEmail($email)
    {
        $this->email = $email;
    
        return $this;
    }

    /**
     * Get email
     *
     * @return string 
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * Set telefono
     *
     * @param string $telefono
     * @return Contacto
     */
    public function setTelefono($telefono)
    {
        $this->telefono = $telefono;
    
        return $this;
    }

    /**
     * Get telefono
     *
     * @return string 
     */
    public function getTelefono()
    {
        return $this->telefono;
    }

    /**
     * Set provincia
     *
     * @param string $provincia
     * @return Contacto
     */
    public function setProvincia($provincia)
    {
        $this->provincia = $provincia;
    
        return $this;
    }

    /**
     * Get provincia
     *
     * @return string 
     */
    public function getProvincia()
    {
        return $this->provincia;
    }

    /**
     * Set consulta
     *
     * @param string $consulta
     * @return Contacto
     */
    public function setConsulta($consulta)
    {
        $this->consulta = $consulta;
    
        return $this;
    }

    /**
     * Get consulta
     *
     * @return string 
     */
    public function getConsulta()
    {
        return $this->consulta;
    }

    /**
     * Set respondido
     *
     * @param boolean $respondido
     * @return Contacto
     */
    public function setRespondido($respondido)
    {
        $this->respondido = $respondido;
    
        return $this;
    }

    /**
     * Get respondido
     *
     * @return boolean 
     */
    public function getRespondido()
    {
        return $this->respondido;
    }

    /**
     * Set anotaciones
     *
     * @param string $anotaciones
     * @return Contacto
     */
    public function setAnotaciones($anotaciones)
    {
        $this->anotaciones = $anotaciones;
    
        return $this;
    }

    /**
     * Get anotaciones
     *
     * @return string 
     */
    public function getAnotaciones()
    {
        return $this->anotaciones;
    }

    /**
     * Set created_at
     *
     * @param \DateTime $createdAt
     * @return Contacto
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;
    
        return $this;
    }

    /**
     * Get created_at
     *
     * @return \DateTime 
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * Set modified_at
     *
     * @param \DateTime $modifiedAt
     * @return Contacto
     */
    public function setModifiedAt($modifiedAt)
    {
        $this->modified_at = $modifiedAt;
    
        return $this;
    }

    /**
     * Get modified_at
     *
     * @return \DateTime 
     */
    public function getModifiedAt()
    {
        return $this->modified_at;
    }
    
    
    /*****************  CALLBACKS **************************************/
    
    
    /**
     * Now we tell doctrine that before we persist or update we call the updatedTimestamps() function.
     *
     * @ORM\PrePersist
     * @ORM\PreUpdate
     */
    public function updatedTimestamps()
    {
    	$this->setModifiedAt(new \DateTime(date('Y-m-d H:i:s')));
    
    	if($this->getCreatedAt() == null)
    	{
    		$this->setCreatedAt(new \DateTime(date('Y-m-d H:i:s')));
    	}
    }
    
}